﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;

namespace LdtJudge.DataEngine.Model.XMLConfigModel.OptimizeConfigModel
{
    /// <summary>
    /// 要素优选节点配置
    /// </summary>
    [Serializable]
    [XmlRootAttribute("xmllabel", IsNullable = false)]
    public class OptimizeFactXmlLable
    {
        /// <summary>
        /// 节点编号
        /// </summary>
        [XmlAttribute("code")]
        public string Code { get; set; }
        /// <summary>
        /// 节点的xmlpath路径
        /// </summary>
        [XmlAttribute("xpath")]
        public string Xmlpath { get; set; }
        /// <summary>
        /// 当前节点优选类型
        /// </summary>
        [XmlAttribute("优选类型")]
        public string OptimizeType { get; set; }
        /// <summary>
        /// 数据源优先级
        /// </summary>
        [XmlAttribute("优先级")]
        public string OptimizePriority { get; set; }
        /// <summary>
        /// 唯一数据源
        /// </summary>
        [XmlAttribute("唯一数据源")]
        public string OnlyData { get; set; }

        private SingnodeList _SignList = new SingnodeList();

        /// <summary>
        /// 标识列集合
        /// </summary>
        [XmlElementAttribute("signnodeList")]
        public SingnodeList SignList
        {
            get { return _SignList; }
            set { _SignList = value; }
        }

        private List<OptimizeFactElement> _optimizeFactElements = new List<OptimizeFactElement>();

        /// <summary>
        /// 属性配置信息
        /// </summary>
        [XmlElementAttribute("element")]
        public List<OptimizeFactElement> OptimizeFactElements
        {
            get { return _optimizeFactElements; }
            set { _optimizeFactElements = value; }
        }


    }

    /// <summary>
    /// 标识列集合
    /// </summary>
    [Serializable]
    [XmlRootAttribute("signnodeList", IsNullable = false)]
    public class SingnodeList
    {
        private List<NodeConfig> _SignList = new List<NodeConfig>();
        /// <summary>
        /// 标识属性集合
        /// </summary>
        [XmlElementAttribute("signnode")]
        public List<NodeConfig> Signnode
        {
            get { return _SignList; }
            set { _SignList = value; }
        }

    }

    /// <summary>
    /// 节点集合内容
    /// </summary>
    [Serializable]
    [XmlRootAttribute("signnode", IsNullable = false)]
    public class NodeConfig
    {
        private string code;
        /// <summary>
        /// 编号
        /// </summary>
        [XmlAttribute("code")]
        public string Code { get => code; set => code = value; }
    }
}
